<?php

namespace app\model\admin\sgz;

use laytp\BaseModel;
use think\model\concern\SoftDelete;

class SgzBattleTeam extends BaseModel
{
    use SoftDelete;
    protected $name = 'sgz_battle_team';

    public function master(){
        return $this->hasOne("SgzGenerals","id","master_generals_id");
    }

    public function oneGenerals(){
        return $this->hasOne("SgzGenerals","id","one_generals_id");
    }

    public function twoGenerals(){
        return $this->hasOne("SgzGenerals","id","two_generals_id");
    }

    public function battle(){
        return $this->hasOne("SgzBattle","id","battle_id")->where('is_show',1);
    }

}